package com.to_door_recycle.model.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 地址表
 * @TableName address
 */
@TableName(value ="address")
@Data
public class Address implements Serializable {
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 省编号
     */
    @TableField(value = "province_number")
    private String provinceNumber;

    /**
     * 市编号
     */
    @TableField(value = "city_number")
    private String cityNumber;

    /**
     * 县编号
     */
    @TableField(value = "county_number")
    private String countyNumber;

    /**
     * 省名称
     */
    @TableField(value = "province_name")
    private String provinceName;

    /**
     * 市名称
     */
    @TableField(value = "city_name")
    private String cityName;

    /**
     * 县名称
     */
    @TableField(value = "county_name")
    private String countyName;

    /**
     * 详细地址
     */
    @TableField(value = "detail_address")
    private String detailAddress;

    /**
     * 楼层
     */
    @TableField(value = "floor")
    private String floor;

    /**
     * 门牌号
     */
    @TableField(value = "door_number")
    private String doorNumber;

    /**
     * 联系人名称
     */
    @TableField(value = "contact_name")
    private String contactName;

    /**
     * 电话
     */
    @TableField(value = "phone")
    private String phone;

    /**
     * 默认状态
     */
    @TableField(value = "defaulted")
    private Integer defaulted;

    /**
     * 用户id
     */
    @TableField(value = "user_id")
    private Long userId;

    /**
     * 用户的最近一次的编辑时间
     */
    @TableField(value = "edit_time")
    private Date editTime;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private Date updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Address other = (Address) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getProvinceNumber() == null ? other.getProvinceNumber() == null : this.getProvinceNumber().equals(other.getProvinceNumber()))
            && (this.getCityNumber() == null ? other.getCityNumber() == null : this.getCityNumber().equals(other.getCityNumber()))
            && (this.getCountyNumber() == null ? other.getCountyNumber() == null : this.getCountyNumber().equals(other.getCountyNumber()))
            && (this.getProvinceName() == null ? other.getProvinceName() == null : this.getProvinceName().equals(other.getProvinceName()))
            && (this.getCityName() == null ? other.getCityName() == null : this.getCityName().equals(other.getCityName()))
            && (this.getCountyName() == null ? other.getCountyName() == null : this.getCountyName().equals(other.getCountyName()))
            && (this.getDetailAddress() == null ? other.getDetailAddress() == null : this.getDetailAddress().equals(other.getDetailAddress()))
            && (this.getFloor() == null ? other.getFloor() == null : this.getFloor().equals(other.getFloor()))
            && (this.getDoorNumber() == null ? other.getDoorNumber() == null : this.getDoorNumber().equals(other.getDoorNumber()))
            && (this.getContactName() == null ? other.getContactName() == null : this.getContactName().equals(other.getContactName()))
            && (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone()))
            && (this.getDefaulted() == null ? other.getDefaulted() == null : this.getDefaulted().equals(other.getDefaulted()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getEditTime() == null ? other.getEditTime() == null : this.getEditTime().equals(other.getEditTime()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getProvinceNumber() == null) ? 0 : getProvinceNumber().hashCode());
        result = prime * result + ((getCityNumber() == null) ? 0 : getCityNumber().hashCode());
        result = prime * result + ((getCountyNumber() == null) ? 0 : getCountyNumber().hashCode());
        result = prime * result + ((getProvinceName() == null) ? 0 : getProvinceName().hashCode());
        result = prime * result + ((getCityName() == null) ? 0 : getCityName().hashCode());
        result = prime * result + ((getCountyName() == null) ? 0 : getCountyName().hashCode());
        result = prime * result + ((getDetailAddress() == null) ? 0 : getDetailAddress().hashCode());
        result = prime * result + ((getFloor() == null) ? 0 : getFloor().hashCode());
        result = prime * result + ((getDoorNumber() == null) ? 0 : getDoorNumber().hashCode());
        result = prime * result + ((getContactName() == null) ? 0 : getContactName().hashCode());
        result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());
        result = prime * result + ((getDefaulted() == null) ? 0 : getDefaulted().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getEditTime() == null) ? 0 : getEditTime().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", provinceNumber=").append(provinceNumber);
        sb.append(", cityNumber=").append(cityNumber);
        sb.append(", countyNumber=").append(countyNumber);
        sb.append(", provinceName=").append(provinceName);
        sb.append(", cityName=").append(cityName);
        sb.append(", countyName=").append(countyName);
        sb.append(", detailAddress=").append(detailAddress);
        sb.append(", floor=").append(floor);
        sb.append(", doorNumber=").append(doorNumber);
        sb.append(", contactName=").append(contactName);
        sb.append(", phone=").append(phone);
        sb.append(", defaulted=").append(defaulted);
        sb.append(", userId=").append(userId);
        sb.append(", editTime=").append(editTime);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}